#ifndef PHONELOGINWIDGET_H
#define PHONELOGINWIDGET_H

#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QIcon>
#include <QGridLayout>
#include <QPushButton>
#include <QTimer>

#include "LoginWidget.h"

class PhoneLoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PhoneLoginWidget(QWidget *parent = nullptr);

private slots:
    void switchMode();
    void sendVerifyCode();
    void clickSubmitBtn();
    void countDown();
    void phoneLoginDone(bool success, const QString& err);
    void phoneRegisterDone(bool success, const QString& err);

private:
    QLabel* m_tipLabel = nullptr;
    QLineEdit* m_phoneEdit = nullptr;
    QLineEdit* m_verifyCodeEdit = nullptr;
    QPushButton* m_submitBtn = nullptr;
    QPushButton* m_verifyCodeBtn = nullptr;
    QPushButton* m_switchToUsernameBtn = nullptr;
    QPushButton* m_switchModeBtn = nullptr;

    bool m_isLoginMode = true;
    QString m_phone;
    QTimer m_timer;
    int m_interval = 30;
signals:

};

#endif // PHONELOGINWIDGET_H
